package com.itheima.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class OfTest {
    
    public static void main(String[] args) {
//Stream OF
        List<String> collect = Stream.of("1", "2", "3").collect(Collectors.toList());
        System.out.println(collect);
        //Arrays.
        List<String> collect1 = Arrays.stream(new String[]{"1", "2", "3"}).collect(Collectors.toList());
        System.out.println(collect1);
        Stream<String> stream1 = Stream.of(new String[]{"1", "2", "3"});
        stream1.forEach(System.out::println);
        
        //
        
        Stream<String> stringStream = Stream.of("1", "2", "3");
        stringStream.forEach(v -> System.out.println(v));
        
        Stream<Object> objectStream = Stream.of("1", 2, true, new St());
        
        Integer[] numbers = new Integer[]{1, 2, 3, 4, 5, 6};
        Stream<Integer> stream = Arrays.stream(numbers);
        
    }
}

class St {
}
